package javaBase.nowcoder.HJ13_B_句子逆序;

import java.util.Scanner;
import java.util.Stack;
import java.util.Arrays;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String sArr[] = s.split(" ");

        Stack<String> stack = new Stack<>();
        stack.addAll(Arrays.asList(sArr));
        while (!stack.isEmpty()) {
            System.out.print(stack.pop() + " ");
        }
        Stack<String> ss = new Stack<>();

        stack.addAll(Arrays.asList(sArr));

    }
}
